#include"index.hpp"
#include"util.hpp"
#include"search.hpp"
#include<cstdio>
const std::string input_path="/home/cjk/boost-search-engine/raw_html/raw.txt";

int main()
{
   ns_search::Searcher * seach = new ns_search::Searcher();
  std::string query;
  char  buffer[2024];
  std::string jsonstring;
  seach->IintSeacher(input_path); 
  while(true)
  {  
    std::cout<<"请输入要查询的内容# "<<std::endl;
    fgets(buffer,sizeof(buffer)-1,stdin);
    buffer[strlen(buffer)-1]=0;
    query=buffer;   
    seach->Seach(query,&jsonstring);
    std::cout<<jsonstring<<std::endl;
  }
  return 0;
}
